﻿{include file="public/header"}
<link href="{$Think.DOMAIN_SRC}/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<title>益鸟维修后台登录</title>
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value="" />
<div class="header"></div>
<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form class="form form-horizontal"  method="post">
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-xs-8">
          <input  name="username" type="text" placeholder="账户" class="input-text size-L" required>
        </div>
      </div>

        <div class="row cl">
            <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
            <div class="formControls col-xs-8">

                <select  class="input-text size-L" required  name="city"  >
                    <option selected="selected" value="">请选择</option>
                    {volist name='city' id='v'}
                    <option value="{$v.id}">{$v.title}</option>
                    {/volist}</select>
            </div>
        </div>
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-xs-8">
          <input  name="password" type="password" placeholder="密码" class="input-text size-L" required>
        </div>
      </div>
        <div class="row cl">

            <div class="formControls col-8 col-offset-3">
                <input class="input-text size-L" type="text" placeholder="验证码" onblur="if(this.value==''){this.value='验证码:'}" onfocus="if(this.value=='验证码:'){this.value='';}" value="" style="width:150px;" name="code" required>
                <img src="{:url('index/login/code')}" alt="captcha" width="100" height="40" id="verifyImg"/> <a id="kanbuq" onClick='freshVerify()'>看不清，换一张</a>
            </div>
        </div>

      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <button type="button" class="btn btn-success radius size-L radius">&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;</button>
          <button type="reset" class="btn btn-default radius size-L">&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;</button>
        </div>
      </div>
    </form>
  </div>
</div>

<div class="footer" style="padding: 0"><a href="http://www.miitbeian.gov.cn">蜀ICP备12010478号 </a></div>
{include file="public/footer"}
<script type='text/javascript'>
    function freshVerify()
    {
        document.getElementById('verifyImg').src='__URL__/code/'+Math.random();
    }
   $('.radius').click(function () {
         var src="{:Url('index/Login/login')}";
        $.ajax({
            type: 'POST',
            url: src,
            dataType: 'json',
            data:$('form').serializeArray(),
            success: function (data) {
                if (typeof data == 'string') {
                    var res=JSON.parse(data);
                    console.log(res)
                }else {
                    var res=data;
                }

                if(res.code==200){
                    layer.msg(res.msg, {icon: 1, time: 2000}, function (index,layero) {
                        setTimeout(window.location.href="{:Url('index/index/index')}", 1);
                    });
                }else{
                    layer.msg(res.msg,{icon: 5,time:1000});
                }

            },
            error: function (data) {
                console.log(data.msg);
            },
        });

    });
</script>
</body>
</html>
